package com.bytes32.classification.tree.dataset;

import java.util.Iterator;

import org.apache.hadoop.io.Writable;

/**
 * Separates the way a feature is
 * processed, un-ordered (labels) and ordered (continuous)
 * @author murariuf
 *
 */
public interface FeatureProcessor<E> extends Writable{
	
	/**
	 * Adds a number to the feature values
	 * @param seq
	 */
	void handleString(String seq) throws InvalidFeatureValueException;
		
	/**
	 * Returns the number of distinct values for un-ordered features
	 * and the number of splits for ordered features
	 * @return
	 */
	long getCount();
	
	/**
	 * Returns the total number of values added to the processor
	 * @return
	 */
	long getTotalCount();
	
	/**
	 * Iterates over values 
	 * in this processor
	 * @return
	 */
	Iterator<E> iterator();
	
	/**
	 * ( Optional ) If possible it will compact all
	 * the counters into a reduced space
	 */
	void compact();
	
}
